package com.sgst.job.services.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sgst.job.services.entity.EquipInfo;
import com.sgst.job.services.mapper.EquipInfoMapper;
import com.sgst.job.services.service.IEquipInfoService;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author thinking
 * @since 2020-04-22
 */
@Service
@DS("slave")
public class EquipInfoServiceImpl extends ServiceImpl<EquipInfoMapper, EquipInfo> implements IEquipInfoService {

    @DS("master")
    @Override
    public void addEquipInfo(List<EquipInfo> equipInfo){
        saveBatch(equipInfo);
    }

    @Override
    @DS("slave")
    public List<EquipInfo> listEquipInfo() {
        return lambdaQuery().in(EquipInfo::getInsCode, Arrays.asList("shjt", "shtj", "shhl", "hdsf")).list();
    }
}
